package com.game.modular.game.act.task;

import com.game.comment.core.ResponseResult;
import com.game.comment.util.JwtUtils;
import com.game.modular.gameCore.task.domain.CoreTaskConfig;
import com.game.modular.gameCore.task.service.impl.CoreTaskConfigServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import java.util.List;


@Api(tags = "任务行为")
@Validated
@RestController
@AllArgsConstructor
@RequestMapping("/playerTaskAct")
public class PlayerTaskAction {
    private CoreTaskConfigServiceImpl coreTaskConfigService;

    @ApiOperation("获取列表")
    @PostMapping("/list")
    public ResponseResult<List<CoreTaskConfig>> list(@RequestHeader String token) {
        Long userId = JwtUtils.getUserId(token);
        return ResponseResult.success(coreTaskConfigService.listCache());
    }
}
